#coding:utf-8
from django.conf.urls.defaults import *
from django.contrib import admin
from django.views.generic import list_detail
from django.contrib import databrowse
import models

admin.autodiscover()

handler404 = 'mobeir.index.error_404'
handler500 = 'mobeir.index.error_500'

urlpatterns = patterns('',
    # Uncomment the next line to enable the admin:
    
    (r'^admin/mobeir/group/audit/$', 'mobeir.admin_view.audit_group'),
    (r'^admin/', include(admin.site.urls)),
    (r'^databrowse/(.*)', databrowse.site.root),
    
    (r'^data/initapp/$','mobeir.data.init_apps'),

    (r'^error/$','mobeir.index.error'),
    
    #通用url配置 '''
    (r'^$','mobeir.index.index'),
    (r'^index/$','mobeir.index.index'),
    (r'^login/$','mobeir.account.login'),
    (r'^logout/$','mobeir.account.logout'),
    (r'^register/$','mobeir.account.register'),
    (r'^setting/$','mobeir.account.set_account'),
    (r'^vcode/$','mobeir.account.vcode_image'),
    (r'^passwd/reset/$','mobeir.account.reset_passwd'),
    
    #搜索部分url配置 '''
    (r'^search/(.*)/(.*)$','mobeir.search.search_by'),
    (r'^search/$','mobeir.search.index'),

    #static file
    (r'^medias/(.*)$', 'django.views.static.serve', {'document_root': 'media'}),
)

urlpatterns += patterns('',
    #动态部分url配置 '''
    (r'^group/note/post/$','mobeir.group.post_note'),
    (r'^note/delete/(\d{1,11})/$','mobeir.group.delete_note'),
    #圈子部分url配置 '''
    (r'^group/$','mobeir.group.index'),
    (r'^group/(\d{1,11})/$','mobeir.group.group'),
    (r'^group/add/$','mobeir.group.add_group'),
    (r'^group/join/$','mobeir.group.join_group'),
    (r'^group/all/$','mobeir.group.all_group'),
    (r'^group/my/$','mobeir.group.my_group'),
    (r'^group/topic/my/$','mobeir.group.my_topics'),
    (r'^group/replies/my/$','mobeir.group.my_replies'),
     #圈子主题部分url配置 '''
    (r'^topic/(\d{1,11})/$','mobeir.topic.topic'),
    (r'^topic/add/$','mobeir.topic.add_topic'),
    (r'^topic/reply/add/$','mobeir.topic.add_reply'),   
)

urlpatterns += patterns('',
    #手机部分url配置 '''
    (r'^device/$','mobeir.device.index'),
    (r'^device/add/$','mobeir.device.add_device'),
    (r'^device/os/(.*)/$','mobeir.device.device_os'),
    (r'^device/detail/(\d{1,11})/$','mobeir.device.detail'),
    (r'^device/star/$','mobeir.device.star'),
    (r'^device/feature/add/(\d{1,11})/$','mobeir.device.add_feature'),
    (r'^device/comment/add/(\d{1,11})/$','mobeir.device.add_comment'),
)

urlpatterns += patterns('',
    
    #应用部分url配置 '''
    (r'^app/$','mobeir.app.index'),
    (r'^app/add/$','mobeir.app.add_app'), 
    (r'^app/os/(.*)/$','mobeir.app.app_os'),
    (r'^app/detail/(\d{1,11})/$','mobeir.app.detail'),
    (r'^app/star/$','mobeir.app.star'),
    (r'^app/feature/add/(\d{1,11})/$','mobeir.app.add_feature'),
    (r'^app/comment/add/(\d{1,11})/$','mobeir.app.add_comment'),                        
)               
